package 一些笔试真题;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a
 * Date: 2022-10-06
 * Time: 15:53
 */

/*
    字符串压缩算法
 */
public class xiaohongshu_2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        char[] str = s.toCharArray();
        int len = str.length;
        for(int i = 0; i < len; i++){
            int count = 0;
            while(i <= len - 2 && str[i] == str[i + 1]){
                i++;
                count++;
            }
            if(count != 0){
                System.out.print(count);
            }
            System.out.print(str[i]);
        }
        System.out.println();
    }
}
